package shiyan4;
class SharedResource {
    private int sharedValue = 0;
    
    public synchronized void increment() {
        sharedValue++;
    }
    
    public synchronized void printValue() {
        System.out.println(sharedValue);
    }
}